package com.wsq.nutz.module;

import java.io.File;

import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.log.Log;
import org.nutz.log.Logs;
import org.nutz.mvc.annotation.AdaptBy;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Fail;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import org.nutz.mvc.impl.AdaptorErrorContext;
import org.nutz.mvc.upload.TempFile;
import org.nutz.mvc.upload.UploadAdaptor;

//@IocBean
//@At("/upload")
//@Ok("json")
//@Fail("http:500")
public class UploadModule {

	private static Log log = Logs.get();
	@At
	//@AdaptBy(type=UploadAdaptor.class , args = "ioc:upload")
	public Object html4(@Param("f")TempFile file , AdaptorErrorContext context){
		//log.debug(file);
		if (file == null || file.getFile().length()<1024) {
			return false;
		}
		File file1  = file.getFile();
		
		return true;
	}
}
